var adYouShi = require("../../ads/youShi/index");
var {
  randomUtils,
  textUtils,
  ocrUtils,
  clickContent,
  clickOneContent,
} = require("../../utils/index");
var TypeEnum = {
  看视频再领: "0",
};

module.exports = {
  init() {
    if (this.checkVideo()) {
      return;
    }
    if (this.checkOver()) {
      return;
    }
  },
  checkVideo() {
    var contents = ["看视频再领"];
    if (clickOneContent(contents)) {
      sleep(randomUtils.getRandom(3.5, 5, 1000));
      adYouShi.startWatchAd();
      this.normal = adYouShi.normal;
      if (this.normal) {
        this.init();
      }
      return true;
    }
    return false;
  },
  checkOver() {
    var content = "开心收下";
    if (clickContent(content)) {
      sleep(randomUtils.getRandom(3.5, 5, 1000));
      return true;
    }
    return false;
  },
};
